package main

import (
	"fmt"
)

type Student struct {
	name string
}

func main()  {
	var a interface{}
	var b float64 = 1.1

	a = b
	
	//带检查的类型断言
	if c,ok := a.(float64);ok {
		fmt.Println(c)
	}else {
		fmt.Println("转化失败")
	}
	
	s1 := Student{}
	s2 := &Student{}
	fmt.Printf("%T\n",s1)
	var s interface{} = s1
	if test,ok := s.(Student); ok {
		fmt.Println("Student",test)
	}

	var t interface{} = s2
	if test,ok := t.(*Student); ok {
		fmt.Println("*Student",test)
	}

}

